import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import Main from "../views/Main.vue";
import ResourceCrud from "../views/ResourceCrud.vue";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/",
    component: Main,
    redirect: "/jobs/list",
    children: [
      {
        path: "/:resource/list",
        name: "resource-crud",
        component: ResourceCrud,
        props: true,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
